package com.yizhuoyan.his.util;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class BeanMap implements Map<String, Object>{
	
	final private HashMap<String, Object> map;
	
	private BeanMap(int size) {
		map=new HashMap<String, Object>(size,1);
	}

	public BeanMap append(String key,Object value) {
		this.map.put(key, value);
		return this;
	}

    public static Map<String,Object> ofOnly(String key,Object value){
        HashMap map=new HashMap(1,1);
        map.put(key, value);
        return map;
    }

	public static BeanMap of(int size){
		BeanMap map=new BeanMap(size);
		return map;
	}

	@Override
	public int size() {
		return map.size();
	}

	@Override
	public boolean isEmpty() {
		return map.isEmpty();
	}

	@Override
	public boolean containsKey(Object key) {
		return map.containsKey(key);
	}

	@Override
	public boolean containsValue(Object value) {
		return map.containsValue(value);
	}

	@Override
	public Object get(Object key) {
		return map.get(key);
	}

	@Override
	public Object put(String key, Object value) {
		return map.put(key, value);
	}

	@Override
	public Object remove(Object key) {
		return map.remove(key);
	}

	@Override
	public void putAll(Map<? extends String, ? extends Object> m) {
		map.putAll(m);
	}

	@Override
	public void clear() {
		map.clear();
	}

	@Override
	public Set<String> keySet() {
		return map.keySet();
	}

	@Override
	public Collection<Object> values() {
		return map.values();
	}

	@Override
	public Set<Entry<String, Object>> entrySet() {
		return map.entrySet();
	}
	
	
	
}
